/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-03
 * Time: 13:01
 */
public class Demo {
    public static void main(String[] args) {
        int sum=0;
        int max=0;
        int num=0;
        int c1,c2,c3,c4;//每个科目的最高分
        int r1,r2,r3,r4;//科目最高分的行号
        c1=0;c2=0;c3=0;c4=0;
        r1=0;r2=0;r3=0;r4=0;
        int Stu[][]= {{80,75,78,93},{67,87,98,65},{86,72,60,76},
                {76,80,76,63},{82,70,90,67}};
        for (int i=0; i<Stu.length; i++) {
            for (int j=0; j<Stu[i].length; j++) {
                sum=sum+Stu[i][j];
            }
            System.out.print((i+1)+"号");
            System.out.println("总成绩为："+sum);
            if(max<sum) {
                max=sum;
                num=i+1;//总成绩最高分的行号
            }

            if(c1<Stu[i][0]){
                c1=Stu[i][0];
                r1=i+1;
            }

            if(c2<Stu[i][1]){
                c2=Stu[i][1];
                r2=i+1;
            }

            if(c3<Stu[i][2]){
                c3=Stu[i][2];
                r3=i+1;
            }

            if(c3<Stu[i][3]){
                c4=Stu[i][3];
                r4=i+1;
            }
        }
        System.out.println("科目1最高分："+c1+"为"+r1+"号");
        System.out.println("科目2最高分："+c2+"为"+r2+"号");
        System.out.println("科目3最高分："+c3+"为"+r3+"号");
        System.out.println("科目4最高分："+c4+"为"+r4+"号");
        System.out.println("总成绩最高分："+max+"为"+num+"号");
    }


    }

